<!doctype html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>注册</title>

    <script type="text/javascript" src="./js/jquery-3.4.1.min.js"></script>
    <style type="text/css">
        body {
            /*background-color:#00b38a;*/
            text-align:center;
        }
        span {
            font-style: normal;
            font-variant-ligatures: normal;
            font-variant-caps: normal;
            font-variant-numeric: normal;
            font-variant-east-asian: normal;
            font-weight: normal;
            font-stretch: normal;
            font-size: 14px;
            line-height: 22px;
            font-family: "Hiragino Sans GB", "Microsoft Yahei", SimSun, Arial, "Helvetica Neue", Helvetica;
        }

    </style>

</head>
<body>

</body>
<script type="text/javascript">
    $(function () {
        var strCookie = document.cookie;
        var arrayCookie = strCookie.split(";");
        var token = "";
        for (var i = 0; i < arrayCookie.length; i ++) {
            var arr = arrayCookie[i].split('=');
            if (arr[0].trim() == 'token') {
                token = arr[1];
            }
        }

        if (token === "") {
            window.location.href = "/static/login.html";
        }

        $.ajax({
            url:'http://localhost/api/user/info/' + token,
            type:'GET',    //GET
            async:false,    //或false,是否异步
            timeout:5000,    //超时时间
            contentType: 'application/json;charset=utf-8',
            success:function(data){
                $('body').text(data + ',欢迎登录系统');
            }
        });
    })

</script>
</html>
